grant-table: defer releasing pages acquired in a grant copy
authorDavid Vrabel <david.vrabel@citrix.com>
Thu, 29 Jan 2015 13:22:22 +0000 (14:22 +0100)
committerJan Beulich <jbeulich@suse.com>
Thu, 29 Jan 2015 13:22:22 +0000 (14:22 +0100)
commitd28f42f2703e483116bafd2b0b76a32af67d83ad
treeb7d20b1366f2e6600b9cdda22a859874bda22989
parent3c72f8c2cf19f735d813081c836f03e3078ee5c1
grant-table: defer releasing pages acquired in a grant copy

Acquiring a page for the source or destination of a grant copy is an
expensive operation.  A common use case is for two adjacent grant copy
ops to operate on either the same source or the same destination page.

Instead of always acquiring and releasing destination and source pages
for each operation, release the page once it is no longer valid for
the next op.

If either the source or destination domains changes both pages are
released as it is unlikely that either will still be valid.

XenServer's performance benchmarks show modest improvements in network
receive throughput (netback uses grant copy in the guest Rx path) and
no regressions in disk performance (using tapdisk3 which grant copies
as the backend).

                         Baseline   Deferred Release
Interhost receive to VM   7.2 Gb/s  ~9 Gbit/s
Interhost aggregate      24 Gb/s    28 Gb/s
Intrahost single stream  14 Gb/s    14 Gb/s
Intrahost aggregate      34 Gb/s    36 Gb/s
Aggregate disk write    900 MB/s   900 MB/s
Aggregate disk read     890 MB/s   890 MB/s

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/grant_table.c